#itkang/centos:zookeeper
#version 0.01
FROM centos
MAINTAINER itkang "itkang@126.com"
RUN yum install -y wget
RUN yum install -y tar
RUN yum install -y openssh openssh-server openssh-clients
RUN mkdir /var/run/sshd
RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
RUN /bin/echo 'root:itkang.com' |chpasswd
RUN useradd admin
RUN /bin/echo 'admin:itkang.com' |chpasswd
RUN /bin/sed -i 's/.*session.*required.*pam_loginuid.so.*/session optional pam_loginuid.so/g' /etc/pam.d/sshd
RUN /bin/echo -e "LANG=\"en_US.UTF-8\"" > /etc/default/local
RUN yum install java-1.8.0-openjdk -y
RUN mkdir /usr/zookeeper /var/zookeeper /var/log/zookeeper
WORKDIR /usr/zookeeper
RUN wget http://git.oschina.net/itkang/docker_plugins/raw/master/zookeeper-3.4.5.tar.gz
RUN tar -zxvf zookeeper-3.4.5.tar.gz
RUN mv zookeeper-3.4.5 /home
WORKDIR /home/zookeeper-3.4.5/conf/
RUN wget http://git.oschina.net/itkang/docker_plugin_config/raw/master/zoo.cfg
WORKDIR /var/zookeeper
RUN wget http://git.oschina.net/itkang/docker_plugin_config/raw/master/myid
EXPOSE 22
EXPOSE 2181
CMD /home/zookeeper-3.4.5/bin/zkServer.sh start && /usr/sbin/sshd -D
